{% extends 'base.html' %}
{% load static %}
{% block title %}
    我的收藏
{% endblock %}
{% block body %}
	<ul class="cart_list_th clearfix">
		<li class="col01">商品名称</li>
		<li class="col02">商品原价</li>
		<li class="col03">商品现价</li>
		<li class="col04">数量</li>
		<li class="col05">小计</li>
		<li class="col06">操作</li>
	</ul>
    {% for good in user_fav %}
    	<ul class="cart_list_td clearfix">
        <li class="col01" ></li>
		<li class="col02"><a href="{% url 'goods:detail'  %}?good_id={{ good.good.id }}"><img src="{{ MEDIA_URL }}{{ good.good.goods_pic }}"></a></li>
		<li class="col03">{{ good.good.goods_name }}<br><em>{{ good.good.goods_price }}元</em></li>
		<li class="col04">{{ good.good.goods_old_price }}</li>
		<li class="col05">{{ good.good.goods_price }}元</li>
		<li class="col06">
			<div class="num_add">
				<a href="javascript:;" class="add fl">-</a>
				<input type="text" class="num_show fl" value="1">
				<a href="javascript:;" class="minus fl">+</a>
			</div>
		</li>
		<li class="col07" value="{{ good.good.goods_price }}">{{ good.good.goods_price }}元</li>
		<li class="col08"><a href="{% url 'user:cart' %}?del_good_id={{ good.good.id }}">删除</a></li>
	</ul>
    {% endfor %}
	<ul class="settlements">
		<li class="col03">
            <br>
            共计<b id="good_nums">{{ request.session.user_fav_products_num}}</b>件商品</li>
		<li class="col04"><a href="{% url 'goods:index' %}">OK</a></li>
	</ul>

{% endblock %}

{% block js %}
    <script>
    console.log('dasd');
    window.onload = function () {
        var good_nums = document.querySelectorAll(".col08").length;
        document.querySelector("#good_nums").innerText = good_nums;
    }
    </script>

{% endblock %}





